<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><script src="http://message.csdn.net/shm/msg_new.php?1=1&amp;jsoncallback=_message_callback" defer="defer" type="text/javascript"></script>

    <script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ga.js" async="" type="text/javascript"></script><script id="allmobilize" charset="utf-8" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/allmobilize.js"></script><style type="text/css"></style>
 <meta http-equiv="Cache-Control" content="no-siteapp"><link rel="alternate" media="handheld" href="#">

    <title>PROC编程基础 - dingweili的专栏
        - 博客频道 - CSDN.NET</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="description" content="&nbsp;PROC是ORACLE数据库提供的编程接口之一，其应用十分的广泛，本文通过一个具体的例子，介绍PROC编程的一些经验及应注意的地方。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 例子程序：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;sqlc">
    <script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ad.js"></script>
        <!--new top-->
       
        <link rel="stylesheet" href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/index.css">
        <!--new top-->

    <link rel="Stylesheet" type="text/css" href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/style.css">
    <link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="http://blog.csdn.net/dingweili/rss/list">
    <link rel="shortcut icon" href="http://csdnimg.cn/public/favicon.ico">
    <link type="text/css" rel="stylesheet" href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/default.css">
 


<script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/share.js"></script><script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/tracking.js" charset="utf-8" type="text/javascript"></script><script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/main_002.js" charset="utf-8" type="text/javascript"></script><link type="text/css" rel="stylesheet" href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/bdsstyle.css"><link rel="stylesheet" type="text/css" href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/style_003.css"><link href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/style_002.css" rel="stylesheet" type="text/css"><script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/logger.js"></script><link href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/share_style0_16.css" rel="stylesheet"></head>
<body><iframe style="display: none;" frameborder="0"></iframe>
    
   
      <!--new top-->
    <script id="toolbar-tpl-scriptId" fixed="true" prod="blog" skin="black" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/html.js" type="text/javascript"></script><div class="csdn-toolbar csdn-toolbar-skin-black ">        <div class="container row center-block ">          <div class="col-md-3 pull-left logo clearfix"><a href="http://www.csdn.net/?ref=toolbar" title="CSDN首页" target="_blank" class="icon"></a><a title="频道首页" href="http://blog.csdn.net/?ref=toolbar_logo" target="_blank" class="img blog-icon"></a></div>          <div class="pull-right login-wrap unlogin">            <ul class="btns">              <li class="loginlink"><a href="https://passport.csdn.net/account/login?ref=toolbar" target="_top">登录&nbsp;</a>|<a target="_top" href="https://passport.csdn.net/account/register?ref=toolbar">&nbsp;注册</a></li>              <li class="search">                <div class="icon on-search-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <form action="http://so.csdn.net/search" method="get" target="_blank">                      <input value="toolbar" name="ref" accesskey="2" type="hidden">                      <div class="border">                        <input placeholder="搜索" name="q" accesskey="2" type="text"><span class="icon-enter-sm"></span>                      </div>                    </form>                  </div>                </div>              </li>              <li class="favor">                <div class="icon on-favor-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div style="display:none;" class="favor-success"><span class="msg">收藏成功</span>                      <div class="btns"><span class="btn btn-primary ok">确定</span></div>                    </div>                    <div style="display:none;" class="favor-failed"><span class="icon-danger-lg"></span><span class="msg">收藏失败，请重新收藏</span>                      <div class="btns"><span class="btn btn-primary ok">确定</span></div>                    </div>                    <form role="form" class="form-horizontal favor-form">                      <div class="form-group">                        <div class="clearfix">                          <label for="input-title" class="col-sm-2 control-label">标题</label>                          <div class="col-sm-10">                            <input value="PROC编程基础 - dingweili的专栏 - 博客频道 - CSDN.NET" id="inputTitle" placeholder="" class="title form-control" type="text">                          </div>                        </div>                        <div class="alert alert-danger"><strong></strong>标题不能为空</div>                      </div>                      <div class="form-group">                        <label for="input-url" class="col-sm-2 control-label">网址</label>                        <div class="col-sm-10">                          <input value="http://blog.csdn.net/dingweili/article/details/6128785" id="input-url" placeholder="" class="url form-control" type="text">                        </div>                      </div>                      <div class="form-group">                        <label for="input-tag" class="col-sm-2 tag control-label">标签</label>                        <div class="col-sm-10">                          <input id="input-tag" class="form-control tag" type="text">                        </div>                      </div>                      <div class="form-group">                        <label for="input-description" class="description col-sm-2 control-label">摘要</label>                        <div class="col-sm-10">                          <textarea id="input-description" class="form-control description"></textarea>                        </div>                      </div>                      <div class="form-group">                        <div class="col-sm-offset-2 col-sm-10 ft">                          <div class="col-sm-4 pull-left">                            <div class="checkbox">                              <label>                                <input name="share" checked="checked" class="share" type="checkbox">公开                              </label>                            </div>                          </div>                          <div class="col-sm-8 pull-right favor-btns">                            <button type="button" class="cancel btn btn-default">取消</button>                            <button type="submit" class="submit btn btn-primary">收藏</button>                          </div>                        </div>                      </div>                    </form>                  </div>                </div>              </li>              <li class="notify">                <div style="display:none" class="number"></div>                <div style="display:none" class="icon-hasnotes-sm"></div>                <div id="header_notice_num"></div>                <div class="icon on-notify-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div id="note1" class="csdn_note">                      <div class="box"></div>                    <iframe src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/a.htm" allowtransparency="true" style="z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;background:transparent" frameborder="0"></iframe></div>                  </div>                </div>              </li>              <li class="ugc">                <div class="icon on-ugc-icon">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <dl>                      <dt><a href="http://geek.csdn.net/news/expert?ref=toolbar" target="_blank" class="p-news clearfix"><em class="icon"></em><span>分享资讯</span></a></dt>                      <dt><a href="http://share.csdn.net/slides/new?ref=toolbar" target="_blank" class="p-doc clearfix"><em class="icon"></em><span>传PPT/文档</span></a></dt>                      <dt><a href="http://bbs.csdn.net/topics/new?ref=toolbar" target="_blank" class="p-ask clearfix"><em class="icon"></em><span>提问题</span></a></dt>                      <dt><a href="http://write.blog.csdn.net/postedit?ref=toolbar" target="_blank" class="p-blog clearfix"><em class="icon"></em><span>写博客</span></a></dt>                      <dt><a href="http://u.download.csdn.net/upload?ref=toolbar" target="_blank" class="p-src clearfix"><em class="icon"></em><span>传资源</span></a></dt>                      <dt><a href="https://code.csdn.net/projects/new?ref=toolbar" target="_blank" class="c-obj clearfix"><em class="icon"></em><span>创建项目</span></a></dt>                      <dt><a href="https://code.csdn.net/snippets/new?ref=toolbar" target="_blank" class="c-code clearfix"><em class="icon"></em><span>创建代码片</span></a></dt>                    </dl>                  </div>                </div>              </li>              <li class="profile">                <div class="icon on-profile-icon"><img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/100x100.jpg" class="curr-icon-img">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div class="bd">                      <dl class="clearfix">                        <dt class="pull-left img"><a target="_blank" href="http://my.csdn.net/?ref=toolbar" class="avatar"><img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/100x100.jpg"></a></dt>                        <dd class="info"><a target="_blank" href="http://my.csdn.net/?ref=toolbar" class="nickname"></a><a class="set-nick" href="https://passport.csdn.net/account/profile">设置昵称<span class="write-icon"></span></a><span class="dec"><a class="fill-dec" href="http://my.csdn.net/" target="_blank">编辑自我介绍，让更多人了解你<span class="write-icon"></span></a></span></dd>                      </dl>                    </div>                    <div class="ft clearfix"><a target="_blank" href="http://my.csdn.net/my/account/changepwd?ref=toolbar" class="pull-left"><span class="icon-cog"></span>帐号设置</a><a href="https://passport.csdn.net/account/logout?ref=toolbar" target="_top" class="pull-right "><span class="icon-signout"></span><span class="out">退出</span></a></div>                  </div>                </div>              </li>              <li class="apps">                <div class="icon on-apps-icon">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                  <div class="detail">                    <dl>                      <dt>                        <h5>社区</h5>                      </dt>                      <dd> <a href="http://blog.csdn.net/?ref=toolbar" target="_blank">博客</a></dd>                      <dd> <a href="http://bbs.csdn.net/?ref=toolbar" target="_blank">论坛</a></dd>                      <dd> <a href="http://download.csdn.net/?ref=toolbar" target="_blank">下载</a></dd>                      <dd><a href="http://share.csdn.net/?ref=toolbar" target="_blank">Share</a></dd>                      <dd><a href="http://geek.csdn.net/?ref=toolbar" target="_blank">极客头条</a></dd>                    </dl>                  </div>                  <div class="detail">                    <dl>                      <dt>                        <h5>服务</h5>                      </dt>                      <dd> <a href="https://code.csdn.net/?ref=toolbar" target="_blank">CODE</a></dd>                      <dd> <a href="http://hero.csdn.net/?ref=toolbar" target="_blank">英雄会</a></dd>                      <dd> <a href="http://huiyi.csdn.net/?ref=toolbar" target="_blank">活动</a></dd>                      <dd> <a href="http://www.csto.com/?ref=toolbar" target="_blank">CSTO</a></dd>                    </dl>                  </div>                  <div class="detail last">                    <dl>                      <dt>                        <h5>俱乐部</h5>                      </dt>                      <dd> <a href="http://cto.csdn.net/?ref=toolbar" target="_blank">CTO俱乐部</a></dd>                      <dd> <a href="http://student.csdn.net/?ref=toolbar" target="_blank">高校俱乐部</a></dd>                    </dl>                  </div>                </div>              </div>            </li>            </ul>          </div>        </div>    </div>
     <!--new top-->
    <div id="container">
        <div id="header">
    <div class="header">
        <div id="blog_title">
            <h2>
                <a href="http://blog.csdn.net/dingweili">dingweili的专栏</a></h2>
            <h3></h3>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
</div>
<div id="navigator">
    <div class="navigator_bg">
    </div>
    <div class="navigator">
        <ul>
                <li id="btnContents"><a href="http://blog.csdn.net/dingweili?viewmode=contents"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_mulu'])">
                    <img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ico_list.gif">目录视图</span></a></li>
                <li id="btnView"><a href="http://blog.csdn.net/dingweili?viewmode=list"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_zhaiyao'])">
                    <img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ico_summary.gif">摘要视图</span></a></li>
                <li id="btnRss"><a href="http://blog.csdn.net/dingweili/rss/list"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_RSS'])">
                    <img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ico_rss.gif">订阅</span></a></li>                

            </ul>
    </div>
</div>
<script type="text/javascript">
    var username = "dingweili";
    var _blogger = username;
    var blog_address = "http://blog.csdn.net/dingweili";
    var static_host = "http://static.blog.csdn.net";
    var currentUserName = "";  
</script>

        <div id="body">
            <div id="main">
                <div class="main">
                        <div class="ad_class">
<div class="notice tracking-ad" data-mod="popu_3"> 

<a href="http://blog.csdn.net/blogdevteam/article/details/38514369" target="_blank">
<font color="blue">7月推荐文章汇总
</font></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a target="_blank" href="http://download.csdn.net/album/detail/257">
<font color="red">Android 精彩案例</font></a>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a target="_blank" href="http://blog.csdn.net/blogdevteam/article/details/38418263">
<font color="blue">【独具慧眼 推荐有礼】找出您心中的技术大牛
</font></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a target="_blank" href="http://blog.csdn.net/blogdevteam/article/details/37874361">博文大赛获奖名单公布 
<font color="red"> 
</font></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a target="_blank" href="http://blog.csdn.net/csdnproduct/article/details/38110573">
<font color="blue">关注社区微信得下载分
</font></a>


</div>                        </div>
                          
<link href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/comment1.css" type="text/css" rel="stylesheet">
<link href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/style1.css" type="text/css" rel="stylesheet">
<script language="JavaScript" type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/jquery_002.js"></script>
<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/main.js"></script>
<div id="article_details" class="details">
    <div class="article_title">   
         <span class="ico ico_type_Original"></span>


    <h1>
        <span class="link_title"><a href="http://blog.csdn.net/dingweili/article/details/6128785">
        PROC编程基础
        </a></span>
    </h1>
</div>

    <div class="article_manage">
        <span class="link_categories">
        分类：
            <a href="http://blog.csdn.net/dingweili/article/category/775653" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_fenlei']);">PROC</a> 
        </span>
    <span class="link_postdate">2011-01-11 12:44</span>
    <span class="link_view" title="阅读次数">308人阅读</span>
    <span class="link_comments" title="评论次数"><a href="#comments" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_pinglun'])">评论</a>(0)</span>
    <span class="link_collect"><a href="javascript:void(0);" onclick="javascript:_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_shoucang']);collectArticle('PROC编程基础','6128785');return false;" title="收藏">收藏</a></span>
    <span class="link_report"><a href="#report" onclick="javascript:_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_jubao']);report(6128785,2);return false;" title="举报">举报</a></span>
    
</div>
<div class="tag2box"><a href="http://www.csdn.net/tag/%e7%bc%96%e7%a8%8b" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">编程</a><a href="http://www.csdn.net/tag/sql" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">sql</a><a href="http://www.csdn.net/tag/user" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">user</a><a href="http://www.csdn.net/tag/oracle" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">oracle</a><a href="http://www.csdn.net/tag/%e6%95%b0%e6%8d%ae%e5%ba%93" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">数据库</a><a href="http://www.csdn.net/tag/date" target="_blank" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">date</a></div>

  
    
<div id="article_content" class="article_content">
<p><span style="font-size: medium;">&nbsp;PROC是ORACLE数据库提供的编程接口之一，其应用十分的广泛，本文通过一个具<br>体的例子，介绍PROC编程的一些经验及应注意的地方。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 例子程序：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;stdio.h&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;string.h&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;stdlib.h&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;sqlda.h&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #include &lt;sqlcpr.h&gt;<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL INCLUDE sqlca;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*RELEASE_CURSOR=YES 使PROC 在执行完后释放与嵌入SQL有关资源*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC ORACLE OPTION (RELEASE_CURSOR = YES);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL BEGIN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; varchar vc_user[20];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long al_empno=0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_ename[11]="";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_hiredate[20]="";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double af_sal=0;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL VAR ac_ename IS STRING(11);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL VAR ac_hiredate IS STRING(20);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL END DECLARE SECTION;<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*错误处理函数*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void sql_error(char *msg)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("/n%s,%ld,%s/n", msg,sqlca.sqlcode,(char *)sqlca.sqlerrm.sqlerrmc);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL ROLLBACK RELEASE;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(-1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; main()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE ERROR: ");<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*连接数据库*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(vc_user.arr,"</span><a href="http://mailto:scott/tiger@DEMO"><span style="font-size: medium;">scott/tiger@DEMO</span></a><span style="font-size: medium;">");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vc_user.len=16;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec sql connect :vc_user;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL DECLARE cur_emp CURSOR FOR<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT EMPNO, ENAME,to_char(HIREDATE,'yyyy/mm/dd hh24:mi:ss'),SAL FROM<br>EMP;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL OPEN cur_emp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; al_empno=0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(ac_ename,"");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(ac_hiredate,"");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; af_sal=0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL FETCH cur_emp INTO :al_empno, :ac_ename:ename_ind,<br>:ac_hiredate:hiredate_ind, :af_sal:sal_ind;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( sqlca.sqlcode == 1403)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>printf("empno=%ld,ename=%s,hiredate=%s,sal=%lf/n",al_empno,ac_ename,ac_hired<br>ate,af_sal);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL CLOSE cur_emp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL ROLLBACK WORK RELEASE;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1、宿主变量的声明<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在PROC中,在SQL语句中用到的变量称为宿主变量。他们应在EXEC SQL BEGIN<br>DECLARE SECTION;与EXEC SQL EDN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 之间声明，如上面所示.在声明宿主变量时应注意以下几点：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1) 在数据库表中定义为VARCHAR2，VARCHAR，CHAR的字段，在PROC中可声明为<br>CHAR，但长度应为它们在表中定义的长度加1，因为PROC中<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CHAR型变量用/0做结尾。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如：ENAME在表中的定义为ename varchar2(10)，在PROC中可定义为：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL BEGIN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ename[11];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL END DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 常见错误说明:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果插入的字符串长度大于10，如：EXEC SQL INSERT INTO EMP(ENAME)<br>VALUES('12345678901');会出现以下错误:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error:ORA-01480: STR 赋值变量缺少空后缀。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果定义为:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL BEGIN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ename[15];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL END DECLARE SECTION;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当插入的字符串长度大于10，小于15时,如：EXEC SQL INSERT INTO EMP(ENAME)<br>VALUES('12345678901');会出现以下错误:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error:ORA-01401: 插入的值对于列过大。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当插入的字符串长度大于15，如：EXEC SQL INSERT INTO EMP(ENAME)<br>VALUES('12345678901234');会出现以下错误:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error:ORA-01401:STR 赋值变量缺少空后缀。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2) 从SQL语句中取字段的值到宿主变量中时，PROC不会自动给宿主变量去掉右<br>空格。而是以在DECLARE SECTION 中定义的长度为准(与 表中定义的无关)不足补右空<br>格.如果不注意这一点，在PROC中进行字符串操作时（如比较相等）会出错。如:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL BEGIN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ename[10];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL END DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果ENAME在表中的值为'abc',则取出的值为'abc ';<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 可用语句EXEC SQL VAR重定义CHAR型变量。这样宿主变量会自动去掉右空格。如<br>下:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL BEGIN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ename[11];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL VAR ac_ename IS STRING(11);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL END DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果ENAME在表中的值为'abc',则取出的值为'abc';<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3) 对浮点型的变量，为保证精度，最好是声明成DOUBLE型的.因为DOUBLE型的<br>精度比FLOAT型高很多.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (4) 整型可声明为LONG型(对较长的整型,而且所用的平台支持的话,如在SUN平台<br>上,可声明为LONG LONG型).<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (5) DATE型的处理：DATE型一般声明为CHAR(20)。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 往表中插入DATE型数据时,一般用TO_DATE()函数进行类型转换,取出值时一般用<br>TO_CHAR()函数进行类型转换.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL select to_char(hiredate,'yyyy/mm/dd hh24:mi:ss') into<br>:ac_hire_date from EMP where empno=1234;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL insert into EMP(EMPNO,HIREDATE)<br>values(123,to_date(:ac_hiredate,'yyyy/mm/dd hh24:mi:ss');<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2、宿主变量的作用范围<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果宿主变量在所有的函数之外声明，则他们是全局变量。在使用之前要注意把<br>变量的值初始化，宿主变量也可以在某个函数的内部定义。 这时他们是局部变量。一<br>般都习惯把宿主变量声明为全局变量。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3、数据库的连接与断开<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 数据库的连接有以下两种方法：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(vc_user.arr,"scott/tiger");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vc_user.len=11;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec sql connect :vc_user;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(user,"scott");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(pass,"tiger");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec sql connect :user identified by :pass;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注意：在有些平台上两种都可以,在有些平台上只能用第一种方法.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在PROC程序中，要记住用EXEC SQL ROLLBACK WORK RELEASE;断开与数据库的连<br>接,并释放相关的数据库资源。<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4、PROC中的NULL值的处理<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果某一字段取出的值是NULL,会报:sqlcode=-1405, sqlerr=ORA-01405: 读取<br>的列值为 NULL<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 并且相应的宿主变量的值不会被改变,为执行该SQL语句之前的值. 常用的处理<br>NULL值的方法有：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)采用指示器变量,此时不会有-1405错误,当必须是所以为NULL的字段都有相应<br>的指示器变量,如果某一字段没有指示器变量,但取出的值<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 为NULL值,则仍然会有-1405错误.当取出的值是NULL时，相应的指示器变量变量<br>为-1，可根据指示器变量的值做响应的处理。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)如果字段较多,可取字段到一个结构体中及与该结构体对应的指示器结构体中<br>.如上面的例子中可定义结构体：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct str_emp{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long al_empno;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_ename;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_hiredate;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double af_sal;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct str_emp_ind{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long al_empno;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_ename;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_hiredate;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double af_sal;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct str_emp str_emp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcut str_emp_ind str_emp_ind;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在取之前可用memset(&amp;str_emp,0,sizeof(str_emp)).清空该结构体,这样如果是<br>字符型的NULL,会为"",整型的NULL会为0,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 浮点型的会为0.00。此时不会有-1405错误。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3)也可采用NVL()函数:举例如下：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL DECLARE authors CURSOR FOR<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT EMPNO, NVL(ENAME,chr(0)),nvl(to_char(HIREDATE,'yyyy/mm/dd<br>hh24:mi:ss'),chr(0)),NVL(SAL,0) FROM EMP;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这样也不会有-1405错误不,当取出的值是NULL时,自动用NVL()中指定的值代替.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CHR(0)也可直接用''代替,如下:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT EMPNO, NVL(ENAME,''),nvl(to_char(HIREDATE,'yyyy/mm/dd<br>hh24:mi:ss'),''),NVL(SAL,0) FROM EMP;<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5、PROC中的错误的处理<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 所有的SQL语句都有可能出错.所以都要加以判断,但每个SQL语句后都加错误判断<br>,太麻烦,可用一个函数如sql_error()来进行错误处理,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 方法:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)定义ql_error()函数。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)在开头加上EXEC SQL WHENEVER SQLERROR DO sql_error();这样当发生<br>sqlca.sqlcode &lt;0 的错误时,程序自动转到sql_error()中执行. 注意:对<br>sqlca.sqlcode &gt;0的错误如 sqlca.sqlcode =1403 是不会转到sql_error()中执行的.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 另外:在UNIX下，可以用OERR 来查找错误的描述。如： ora ORA -1405 查找错<br>误号为-1405的描述.<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6、PROC中调用存储过程的方法<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 要把存储过程放在EXEC SQL EXECUTE 和 END-EXEC;之间，如下所示：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 其中：al_empno,ac_ename 为输入参数,l_return,l_errno,c_errtext 为输出参<br>数。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; al_empno=8888;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(ac_ename,"ABCD");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL EXECUTE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; up_db_emp(:al_empno,:ac_ename,:l_return,:l_errno,:c_errtext);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END-EXEC;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (l_return != 0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("调用UP_PB_EMP存储过程出错<br>,errno=%ld,errtext=%s/n",l_errno,c_errtext);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7、PROC的命令行选项：PROC编译器有很多的命令行选项，在命令行下直接不带<br>参数运行PROC，会列出所有的命令行选项来，并有说明。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)储存过程:编译储存过程是要带上用户名及密码<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proc USERID=scott/tiger sqlcheck=SEMANTICS ireclen=512 iname=test.cpp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)PARSE=NONE 对非SQL代码不进行语法分析，默认对非SQL代码也进行语法分析<br>.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在RED HAD6.3上的ORACLE8.1.5中用PROC时,会提示:/USR/INCLUDE/STDIO.H 及其<br>他的.H文件中有错. 可把PARSE=NONE加上,就好了.<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8、注意加上：EXEC ORACLE OPTION (RELEASE_CURSOR = YES);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RELEASE_CURSOR=YES 使PROC 在执行完后释放与嵌入SQL有关资源，保证在该<br>PROC程序执行完后，ORACLE不会锁住数据库资源，如锁表等。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果在PROC中用到ORACA，还要在程序头加上：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC ORACLE OPTION (ORACA=YES);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9、PROC中的类型转换<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一、在C语言中:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)字符型到整型可用ATOI() ATOL(),SSCANF()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)整型,浮点型到字符型,可用SPRINTF()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3)字符型到浮点型用ATOF()不行,最好用SSCANF(),举例如下:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL BEGIN DECLARE SECTION;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double d_demo;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float f_demo;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char ac_text[20]="222";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL END DECLARE SECTION;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)sscanf(ac_text, "%f", &amp;d_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,d_demo=%f/n",ac_text,d_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)sscanf(ac_text, "%lf", &amp;d_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,d_demo=%f/n",ac_text,d_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3)sscanf(ac_text, "%f", &amp;d_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,d_demo=%lf/n",ac_text,d_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (4)sscanf(ac_text, "%lf", &amp;d_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,d_demo=%lf/n",ac_text,d_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("*******************/n");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (5)sscanf(ac_text, "%f", &amp;f_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,f_demo=%f/n",ac_text,f_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (6)sscanf(ac_text, "%lf", &amp;f_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,f_demo=%f/n",ac_text,f_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (7)sscanf(ac_text, "%f", &amp;f_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,f_demo=%lf/n",ac_text,f_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (8)sscanf(ac_text, "%lf", &amp;f_demo);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,f_demo=%lf/n",ac_text,f_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 输出的结果:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,d_demo=0.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,d_demo=222.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,d_demo=222.000032<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,d_demo=222.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *******************<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,f_demo=222.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,f_demo=0.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,f_demo=222.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,f_demo=0.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d_demo=atof(ac_text);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,atof(ac_text)=%f/n",ac_text,d_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d_demo=atof(ac_text);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,atof(ac_text)=%lf/n",ac_text,d_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f_demo=atof(ac_text);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,atof(ac_text)=%f/n",ac_text,f_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f_demo=atof(ac_text);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("ac_text=%s,atof(ac_text)=%lf/n",ac_text,f_demo);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 输出的结果:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,atof(ac_text)=1243288.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,atof(ac_text)=1243288.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,atof(ac_text)=1243288.000000<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ac_text=222.00,atof(ac_text)=1243288.000000<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 从上面的结果可见:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DOUBLE型应采用sscanf(ac_app_capcity, "%lf", &amp;d_app); 打印用"%lf","%f"<br>都可以. (2),(4)正确<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FLOAT型应采用sscanf(ac_app_capcity, "%f", &amp;d_app); 打印用"%lf","%f" 都<br>可以. (5),(7)正确<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 采用ATOF()转换的结果都是错的,所以不要用它。<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 二、写表或从表中取数据时:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)字符型与整型之间可不用转换,采用默认方式。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)字符型与浮点型之间可不用转换,采用默认方式。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3)日期型与字符型之间可用TO_CHAR(),TO_DATE()。<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10、PROC中的4种动态SQL简介<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)动态SQL1: 不能是查询(SELECT)语句,并且没有宿主变量.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 用法:拼一串动态SQL语句,并用EXECUTE IMMEDIATE执行,如:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL EXECUTE IMMEDIATE "CREATE TABLE dyn1 (col1 VARCHAR2(4))";<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)动态SQL2: 不能是查询(SELECT)语句,并且输入的宿主变量数目是知道的,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 用法:拼一串动态SQL语句,用PREPARE,EXECUTE语句执行.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(c_sql, "DELETE FROM EMP WHERE EMPNO = :?");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL PREPARE sql_stmt FROM :c_sql;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL EXECUTE sql_stmt USING :emp_number;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3)动态SQL3: 用于创建动态查询, 并且要查询的字段及输入的宿主变量数目是<br>知道的<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 用法: 拼一串动态SQL语句,用PREPARE分析该语句,并要定义一个CURSOR进行取值<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如:如要查询的数据按一年12月放到12张表中。表名为user_fee_1mon,<br>user_fee_2mon,....可采用动态SQL3来进行查询<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(c_sql,"select c_user_id,c_user_name,to_char(t_date,'yyyy/mm/dd<br>hh:mi:ss'),n_fee/n");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(c_sql,"from USER_FEE_");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(c_sql,ac_mon);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(c_sql," /n where c_user_id = :v1");<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL PREPARE s FROM :c_sql;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL DECLARE cur_user_fee CURSOR FOR s;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL OPEN cur_user_fee USING :ac_user_id;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL FETCH cur_user_fee into<br>:c_user_id,:c_user_name,:c_date,:n_fee);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (sqlca.sqlcode &lt; 0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*FETCH CURSOR失败*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("fetch cursor cur_user_fee<br>fail,sqlcode=%ld,sqlserr=%s",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( sqlca.sqlcode == SQLNOTFOUND)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXEC SQL CLOSE cur_user_fee;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (4)动态SQL4:要处理的字段及输入的宿主变量数目和主变量的类型事先是不知道<br>的,如：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSERT INTO EMP (&lt;unknown&gt;) VALUES (&lt;unknown&gt;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 是最复杂的动态SQL,很少用,在此不做介绍。<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11、SQLCA：SQL是ORACLE的一个结构体，它的域用于最近的一条SQL语句执行后<br>的一些信息，如错误号，错误描述，警告，状态等。常用的<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 域介绍如下:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQLCA.sqlcode:错误号,=0正确,=1403没取到数据<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQLCA.sqlserrm.sqlerrmc:错误描述<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQLCA.sqlerrd[3]:最近的一条SQL语句所处理的行数,如果该语句处理失败,则它<br>的值是不定的,如果错误在一个CURSOR操作中发生,则<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 它的值指已成功处理的行数.在DELETE,UPDATE中,它不包含因外键约束而删除,更<br>新的那些行,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DELETE FROM EMP WHERE DEPT='SALE';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在表EMP中删除20行,但如果表EMP与表ADDRESS有外键约束,导致表ADDRESS也被删<br>除20行,则SQLCA.sqlerrd[3]=20,而不是40。</span></p>
</div>




<!-- Baidu Button BEGIN -->

<div data-bd-bind="1408098267604" class="bdsharebuttonbox bdshare-button-style0-16" style="float: right;">
<a href="#" class="bds_more" data-cmd="more" style="background-position:0 0 !important; background-image: url(http://bdimg.share.baidu.com/static/api/img/share/icons_0_16.png?v=d754dcc0.png) !important"></a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间" style="background-position:0 -52px !important"></a>
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博" style="background-position:0 -104px !important"></a>
<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博" style="background-position:0 -260px !important"></a>
<a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网" style="background-position:0 -208px !important"></a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信" style="background-position:0 -1612px !important"></a>
</div>
<script>window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "1", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
<!-- Baidu Button END -->

<!--192.168.100.35-->
<ul class="article_next_prev">
            <li class="prev_article"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_shangyipian']);location.href='/dingweili/article/details/6115305';">上一篇</span><a href="http://blog.csdn.net/dingweili/article/details/6115305" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_shangyipian'])">23中设计模式</a></li>
            <li class="next_article"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_xiayipian']);location.href='/dingweili/article/details/6129460';">下一篇</span><a href="http://blog.csdn.net/dingweili/article/details/6129460" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_xiayipian'])">使用net-snmp API编程</a></li>
</ul>

<!-- Baidu Button BEGIN -->
<script src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/bds_s_v2.js" type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=1536434"></script>

<script type="text/javascript">
    document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END -->


</div>
      <dl class="blog-associat-tag">
        <dt>主题推荐</dt>
        <dd>
                <a href="http://www.csdn.net/tag/%E7%BC%96%E7%A8%8B" target="_blank" class="blog-tage-red">编程</a> 
                <a href="http://www.csdn.net/tag/%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F" target="_blank" class="blog-tage-red">全局变量</a> 
                <a href="http://www.csdn.net/tag/%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F" target="_blank" class="blog-tage-red">局部变量</a> 
                <a href="http://www.csdn.net/tag/%E7%BC%96%E8%AF%91%E5%99%A8" target="_blank" class="blog-tage-red">编译器</a> 
                <a href="http://www.csdn.net/tag/c%E8%AF%AD%E8%A8%80" target="_blank" class="blog-tage-red">c语言</a> 
        </dd>
    </dl> 


<dl class="blog-ass-articl tracking-ad" data-mod="popu_36" id="res-relatived"> 
     <dt><span>猜你在找</span></dt>    
<dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/zeo112140/article/details/7705555" title="C++性能优化技术导论" strategy="SearchAlgorithm">C++性能优化技术导论</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/woaixiaozhe/article/details/7395497" title="U-Boot下载与编译" strategy="SearchAlgorithm">U-Boot下载与编译</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/yctcgogo/article/details/9799969" title="程序员的自我修养" strategy="SearchAlgorithm">程序员的自我修养</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/fp1355414/article/details/16960055" title="【c语言基础必备】全局变量与局部变量" strategy="SearchAlgorithm">【c语言基础必备】全局变量与局部变量</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/xinyizhangwei/article/details/20958011" title="关于C语言中的全局变量和局部变量" strategy="SearchAlgorithm">关于C语言中的全局变量和局部变量</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/ccy365263452/article/details/17288727" title="全局变量和局部变量的区别-c语言" strategy="SearchAlgorithm">全局变量和局部变量的区别-c语言</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/XSL1990/article/details/16106389" title="C语言中局部变量和全局变量变量的存储类别(static,extern,auto,register)" strategy="SearchAlgorithm">C语言中局部变量和全局变量变量的存储类别(static,extern,auto,register)</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a target="_blank" href="http://blog.csdn.net/huangminqiang201209/article/details/8285351" title="C语言中局部变量和全局变量在内存中的存放位置" strategy="SearchAlgorithm">C语言中局部变量和全局变量在内存中的存放位置</a></dd></dl>

<script type="text/javascript">
    var searchtitletags = 'PROC编程基础' + ',' + '编程,全局变量,局部变量,编译器,c语言';
    searchService({
        index: 'blog',
        query: searchtitletags,
        from: 10,
        size: 10,
        appendTo: '#res-relatived',
        url: 'recommend',
        his: 2,
        client: "blog_cf_enhance",
        tmpl: '<dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="#{ url }" title="#{ title }" strategy="#{ strategy }">#{ title }</a></dd>'
    });

 </script>   


    <div id="ad_cen">
   
          <script type="text/javascript">
              new Ad(4, 'ad_cen');
          </script>
    <iframe src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ad.htm" style="border-width: 0px; overflow: hidden; width: 746px; height: 90px;" scrolling="no" id="ad_frm_0" frameborder="0"></iframe></div>
<div class="comment_class">
    <div id="comment_title" class="panel_head">
        <span class="see_comment">查看评论</span><a name="comments"></a></div>
    <div id="comment_list"><br>&nbsp;&nbsp;暂无评论<br><br><div class="clear"></div></div>
    <div id="comment_bar">
    </div>
    <div id="comment_form"><div class="guest_link">您还没有登录,请<a href="javascript:void(0);" onclick="javascript:csdn.showLogin(function (dat) {js_logined(dat.data.userName);});">[登录]</a>或<a href="http://passport.csdn.net/account/register?from=http%3A%2F%2Fblog.csdn.net%2Fdingweili%2Farticle%2Fdetails%2F6128785">[注册]</a></div></div>

    <div class="announce">
        * 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场<a name="reply"></a><a name="quote"></a></div>
</div>

<script type="text/javascript">
    var fileName = '6128785';
    var commentscount = 0;
    var islock = false
</script>
<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/comment.js"></script>
    <div id="ad_bot">
    <iframe src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ad_002.htm" style="border-width: 0px; overflow: hidden; width: 746px; height: 0px;" scrolling="no" id="ad_frm_1" frameborder="0"></iframe></div>
    <script type="text/javascript">
    new Ad(5, 'ad_bot');
    </script>
<div id="report_dialog">
</div>

<div id="d-top" style="bottom:60px;">
      

       <a id="quick-reply" class="btn btn-top q-reply" title="快速回复" style="display:none;">
            <img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/blog-icon-reply.png" alt="快速回复">
        </a>    

    <a id="d-top-a" class="btn btn-top backtop" style="display: none;" title="返回顶部" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_huidaodingbu'])">         
         <img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/top.png" alt="TOP">
    </a>
</div>
<script type="text/javascript">
    $(function ()
    {
        $("#ad_frm_0").height("90px");

        if($("#comment_content").length>0)
        {
            $("#quick-reply").show();

            $("#quick-reply").click(function(){
                setEditorFocus();
            });
        }       
     
        var d_top = $('#d-top-a');
        document.onscroll = function ()
        {
            var scrTop = (document.body.scrollTop || document.documentElement.scrollTop);
            if (scrTop > 500)
            {
                d_top.show();
            } else
            {
                d_top.hide();
            }
        }
        $('#d-top-a').click(function ()
        {
            scrollTo(0, 0);
            this.blur();
            return false;
        });
    });
  
</script>
<style type="text/css">
    .tag_list
    {
        background: none repeat scroll 0 0 #FFFFFF;
        border: 1px solid #D7CBC1;
        color: #000000;
        font-size: 12px;
        line-height: 20px;
        list-style: none outside none;
        margin: 10px 2% 0 1%;
        padding: 1px;
    }
    .tag_list h5
    {
        background: none repeat scroll 0 0 #E0DBD3;
        color: #47381C;
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        padding: 0 5px;
        margin: 0;
    }
    .tag_list h5 a
    {
        color: #47381C;
    }
    .classify
    {
        margin: 10px 0;
        padding: 4px 12px 8px;
    }
    .classify a
    {
        margin-right: 20px;
        white-space: nowrap;
    }
</style>
<div class="tag_list">
    <h5>
        <a href="http://www.csdn.net/tag/" target="_blank">核心技术类目</a></h5>
    <div class="classify">
<a title="全部主题" href="http://www.csdn.net/tag" target="_blank" onclick="LogClickCount(this,336);">全部主题</a>
<a title="Hadoop" href="http://g.csdn.net/5272865" target="_blank" onclick="LogClickCount(this,336);">Hadoop</a>
<a title="AWS" href="http://g.csdn.net/5272866" target="_blank" onclick="LogClickCount(this,336);">AWS</a>
<a title="移动游戏" href="http://g.csdn.net/5272870" target="_blank" onclick="LogClickCount(this,336);">移动游戏</a>
<a title="Java" href="http://g.csdn.net/5272871" target="_blank" onclick="LogClickCount(this,336);">Java</a>
<a title="Android" href="http://g.csdn.net/5272872" target="_blank" onclick="LogClickCount(this,336);">Android</a>
<a title="iOS" href="http://g.csdn.net/5272873" target="_blank" onclick="LogClickCount(this,336);">iOS</a>
<a title="Swift" href="http://g.csdn.net/5272868" target="_blank" onclick="LogClickCount(this,336);">Swift</a>
<a title="智能硬件" href="http://g.csdn.net/5272869" target="_blank" onclick="LogClickCount(this,336);">智能硬件</a>
<a title="Docker" href="http://g.csdn.net/5272867" target="_blank" onclick="LogClickCount(this,336);">Docker</a>
<a title="OpenStack" href="http://g.csdn.net/5272925" target="_blank" onclick="LogClickCount(this,336);">OpenStack</a>
<a title="VPN" href="http://www.csdn.net/tag/vpn" target="_blank" onclick="LogClickCount(this,336);">VPN</a>
<a title="Spark" href="http://g.csdn.net/5272924" target="_blank" onclick="LogClickCount(this,336);">Spark</a>
<a title="ERP" href="http://www.csdn.net/tag/erp" target="_blank" onclick="LogClickCount(this,336);">ERP</a>
<a title="IE10" href="http://www.csdn.net/tag/ie10" target="_blank" onclick="LogClickCount(this,336);">IE10</a>
<a title="Eclipse" href="http://www.csdn.net/tag/eclipse" target="_blank" onclick="LogClickCount(this,336);">Eclipse</a>
<a title="CRM" href="http://www.csdn.net/tag/crm" target="_blank" onclick="LogClickCount(this,336);">CRM</a>
<a title="JavaScript" href="http://www.csdn.net/tag/javascript" target="_blank" onclick="LogClickCount(this,336);">JavaScript</a>
<a title="数据库" href="http://www.csdn.net/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" target="_blank" onclick="LogClickCount(this,336);">数据库</a>
<a title="Ubuntu" href="http://www.csdn.net/tag/ubuntu" target="_blank" onclick="LogClickCount(this,336);">Ubuntu</a>
<a title="NFC" href="http://www.csdn.net/tag/nfc" target="_blank" onclick="LogClickCount(this,336);">NFC</a>
<a title="WAP" href="http://www.csdn.net/tag/wap" target="_blank" onclick="LogClickCount(this,336);">WAP</a>
<a title="jQuery" href="http://www.csdn.net/tag/jquery" target="_blank" onclick="LogClickCount(this,336);">jQuery</a>
<a title="BI" href="http://www.csdn.net/tag/bi" target="_blank" onclick="LogClickCount(this,336);">BI</a>
<a title="HTML5" href="http://www.csdn.net/tag/html5" target="_blank" onclick="LogClickCount(this,336);">HTML5</a>
<a title="Spring" href="http://www.csdn.net/tag/spring" target="_blank" onclick="LogClickCount(this,336);">Spring</a>
<a title="Apache" href="http://www.csdn.net/tag/apache" target="_blank" onclick="LogClickCount(this,336);">Apache</a>
<a title=".NET" href="http://www.csdn.net/tag/.net" target="_blank" onclick="LogClickCount(this,336);">.NET</a>
<a title="API" href="http://www.csdn.net/tag/api" target="_blank" onclick="LogClickCount(this,336);">API</a>
<a title="HTML" href="http://www.csdn.net/tag/html" target="_blank" onclick="LogClickCount(this,336);">HTML</a>
<a title="SDK" href="http://www.csdn.net/tag/sdk" target="_blank" onclick="LogClickCount(this,336);">SDK</a>
<a title="IIS" href="http://www.csdn.net/tag/iis" target="_blank" onclick="LogClickCount(this,336);">IIS</a>
<a title="Fedora" href="http://www.csdn.net/tag/fedora" target="_blank" onclick="LogClickCount(this,336);">Fedora</a>
<a title="XML" href="http://www.csdn.net/tag/xml" target="_blank" onclick="LogClickCount(this,336);">XML</a>
<a title="LBS" href="http://www.csdn.net/tag/lbs" target="_blank" onclick="LogClickCount(this,336);">LBS</a>
<a title="Unity" href="http://www.csdn.net/tag/unity" target="_blank" onclick="LogClickCount(this,336);">Unity</a>
<a title="Splashtop" href="http://www.csdn.net/tag/splashtop" target="_blank" onclick="LogClickCount(this,336);">Splashtop</a>
<a title="UML" href="http://www.csdn.net/tag/uml" target="_blank" onclick="LogClickCount(this,336);">UML</a>
<a title="components" href="http://www.csdn.net/tag/components" target="_blank" onclick="LogClickCount(this,336);">components</a>
<a title="Windows Mobile" href="http://www.csdn.net/tag/windowsmobile" target="_blank" onclick="LogClickCount(this,336);">Windows Mobile</a>
<a title="Rails" href="http://www.csdn.net/tag/rails" target="_blank" onclick="LogClickCount(this,336);">Rails</a>
<a title="QEMU" href="http://www.csdn.net/tag/qemu" target="_blank" onclick="LogClickCount(this,336);">QEMU</a>
<a title="KDE" href="http://www.csdn.net/tag/kde" target="_blank" onclick="LogClickCount(this,336);">KDE</a>
<a title="Cassandra" href="http://www.csdn.net/tag/cassandra" target="_blank" onclick="LogClickCount(this,336);">Cassandra</a>
<a title="CloudStack" href="http://www.csdn.net/tag/cloudstack" target="_blank" onclick="LogClickCount(this,336);">CloudStack</a>
<a title="FTC" href="http://www.csdn.net/tag/ftc" target="_blank" onclick="LogClickCount(this,336);">FTC</a>
<a title="coremail" href="http://www.csdn.net/tag/coremail" target="_blank" onclick="LogClickCount(this,336);">coremail</a>
<a title="OPhone " href="http://www.csdn.net/tag/ophone" target="_blank" onclick="LogClickCount(this,336);">OPhone </a>
<a title="CouchBase" href="http://www.csdn.net/tag/couchbase" target="_blank" onclick="LogClickCount(this,336);">CouchBase</a>
<a title="云计算" href="http://www.csdn.net/tag/%E4%BA%91%E8%AE%A1%E7%AE%97" target="_blank" onclick="LogClickCount(this,336);">云计算</a>
<a title="iOS6" href="http://www.csdn.net/tag/iOS6" target="_blank" onclick="LogClickCount(this,336);">iOS6</a>
<a title="Rackspace " href="http://www.csdn.net/tag/rackspace" target="_blank" onclick="LogClickCount(this,336);">Rackspace </a>
<a title="Web App" href="http://www.csdn.net/tag/webapp" target="_blank" onclick="LogClickCount(this,336);">Web App</a>
<a title="SpringSide" href="http://www.csdn.net/tag/springside" target="_blank" onclick="LogClickCount(this,336);">SpringSide</a>
<a title="Maemo" href="http://www.csdn.net/tag/maemo" target="_blank" onclick="LogClickCount(this,336);">Maemo</a>
<a title="Compuware" href="http://www.csdn.net/tag/compuware" target="_blank" onclick="LogClickCount(this,336);">Compuware</a>
<a title="大数据" href="http://www.csdn.net/tag/%E5%A4%A7%E6%95%B0%E6%8D%AE" target="_blank" onclick="LogClickCount(this,336);">大数据</a>
<a title="aptech" href="http://www.csdn.net/tag/aptech" target="_blank" onclick="LogClickCount(this,336);">aptech</a>
<a title="Perl" href="http://www.csdn.net/tag/perl" target="_blank" onclick="LogClickCount(this,336);">Perl</a>
<a title="Tornado" href="http://www.csdn.net/tag/tornado" target="_blank" onclick="LogClickCount(this,336);">Tornado</a>
<a title="Ruby" href="http://www.csdn.net/tag/ruby" target="_blank" onclick="LogClickCount(this,336);">Ruby</a>
<a title="Hibernate" href="http://www.csdn.net/hibernate" target="_blank" onclick="LogClickCount(this,336);">Hibernate</a>
<a title="ThinkPHP" href="http://www.csdn.net/tag/thinkphp" target="_blank" onclick="LogClickCount(this,336);">ThinkPHP</a>
<a title="HBase" href="http://www.csdn.net/tag/hbase" target="_blank" onclick="LogClickCount(this,336);">HBase</a>
<a title="Pure" href="http://www.csdn.net/tag/pure" target="_blank" onclick="LogClickCount(this,336);">Pure</a>
<a title="Solr" href="http://www.csdn.net/tag/solr" target="_blank" onclick="LogClickCount(this,336);">Solr</a>
<a title="Angular" href="http://www.csdn.net/tag/angular" target="_blank" onclick="LogClickCount(this,336);">Angular</a>
<a title="Cloud Foundry" href="http://www.csdn.net/tag/cloudfoundry" target="_blank" onclick="LogClickCount(this,336);">Cloud Foundry</a>
<a title="Redis" href="http://www.csdn.net/tag/redis" target="_blank" onclick="LogClickCount(this,336);">Redis</a>
<a title="Scala" href="http://www.csdn.net/tag/scala" target="_blank" onclick="LogClickCount(this,336);">Scala</a>
<a title="Django" href="http://www.csdn.net/tag/django" target="_blank" onclick="LogClickCount(this,336);">Django</a>
<a title="Bootstrap" href="http://www.csdn.net/tag/bootstrap" target="_blank" onclick="LogClickCount(this,336);">Bootstrap</a>
    </div>
</div>

                        <div class="clear">
                        </div>
                    </div>                   
                
            </div>
            <div id="side">
    <div class="side">
<div id="panel_Profile" class="panel">
<ul class="panel_head"><span>个人资料</span></ul>
<ul class="panel_body profile">
<div id="blog_userface">
    <a href="http://my.csdn.net/dingweili" target="_blank">
    <img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/1_dingweili.jpg" title="访问我的空间" style="max-width:90%">
    </a>
    <br>
    <span><a href="http://my.csdn.net/dingweili" class="user_name" target="_blank">dingweili</a></span>
</div>
<div class="interact">
<a href="javascript:void(0);" class="attent" id="span_add_follow" title="[加关注]" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_guanzhu'])"></a>
<a href="javascript:void(0);" class="letter" onclick="loginto(1)" title="[发私信]"></a>
</div>
<div id="blog_medal">
<div id="bms_box"></div></div>
<ul id="blog_rank">
    <li>访问：<span>5273次</span></li>
    <li>积分：<span>165分</span></li>
    <li>排名：<span>千里之外</span></li>
</ul>
<ul id="blog_statistics">
    <li>原创：<span>12篇</span></li>
    <li>转载：<span>0篇</span></li>
    <li>译文：<span>0篇</span></li>
    <li>评论：<span>0条</span></li>
</ul>
</ul>
</div>


<div class="panel" id="panel_Search">
    <ul class="panel_head"><span>文章搜索</span></ul>
    <ul class="panel_body">
        <form id="frmSearch" action="http://so.csdn.net/search" class="form_search" target="_blank">
        <span><input id="inputSearch" class="blogsearch" title="请输入关键字" type="text"></span>
        <input id="btnSubmit" value="搜索" title="search in blog" type="button">
        <input name="q" id="inputQ" type="hidden">
        <input name="t" value="blog" type="hidden">
        <a id="btnSearchBlog" target="_blank"></a>
        </form>
    </ul>
</div>

<script type="text/javascript">
    $(function () {
        $("#btnSubmit").click(function () {           
            search();
        });

        $("#frmSearch").submit(function () {
            search();
            return false;
        });

        function search()
        {
            var url = "http://so.csdn.net/so/search/s.do?q=" + encodeURIComponent($("#inputSearch").val()) + "&u=" + username + "&t=blog";
            window.location.href = url;
        }   
    });
</script><div id="panel_Category" class="panel">
<ul class="panel_head"><span>文章分类</span></ul>
<ul class="panel_body">
             <li>
                <a href="http://blog.csdn.net/dingweili/article/category/771811" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">C++/C</a><span>(2)</span>
            </li>
             <li>
                <a href="http://blog.csdn.net/dingweili/article/category/771812" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">Linux</a><span>(4)</span>
            </li>
             <li>
                <a href="http://blog.csdn.net/dingweili/article/category/773221" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">Makefile</a><span>(0)</span>
            </li>
             <li>
                <a href="http://blog.csdn.net/dingweili/article/category/775819" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">net-snmp</a><span>(3)</span>
            </li>
             <li>
                <a href="http://blog.csdn.net/dingweili/article/category/775653" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">PROC</a><span>(1)</span>
            </li>
             <li>
                <a href="http://blog.csdn.net/dingweili/article/category/773222" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">设计模式</a><span>(2)</span>
            </li>
</ul>
</div><div id="panel_Archive" class="panel">
<ul class="panel_head"><span>文章存档</span></ul>
<ul class="panel_body">
<div id="archive_list">
<!--归档统计-->
<li><a href="http://blog.csdn.net/dingweili/article/month/2011/01">2011年01月</a><span>(9)</span></li><li><a href="http://blog.csdn.net/dingweili/article/month/2010/12">2010年12月</a><span>(3)</span></li>
</div>
</ul>
</div>
<div id="hotarticls" class="panel">
<ul class="panel_head">
    <span>       
阅读排行    </span>
</ul>

<ul class="panel_body itemlist">
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6104344" title="C语言编译器MINGW的使用说明">C语言编译器MINGW的使用说明</a><span>(2044)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6130401" title="移殖net-snmp和应用net-snmp开发详解">移殖net-snmp和应用net-snmp开发详解</a><span>(604)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6109516" title="linux之ls -l|grep &quot;^-&quot;|wc -l命令">linux之ls -l|grep "^-"|wc -l命令</a><span>(443)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6128785" title="PROC编程基础">PROC编程基础</a><span>(305)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6131767" title="RHEL5+net-snmp+监控宝实现服务器监控">RHEL5+net-snmp+监控宝实现服务器监控</a><span>(244)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6106519" title="Linux的Shell编程">Linux的Shell编程</a><span>(102)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6129460" title="使用net-snmp API编程">使用net-snmp API编程</a><span>(95)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6115113" title="跟我一起写 Makefile">跟我一起写 Makefile</a><span>(87)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6138317" title="VMware 网络配置">VMware 网络配置</a><span>(77)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6115305" title="23中设计模式">23中设计模式</a><span>(45)</span>
</li>
</ul>
</div>
<div id="hotarticls2" class="panel">
<ul class="panel_head"><span>评论排行</span></ul>
<ul class="panel_body itemlist">
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6104344" title="C语言编译器MINGW的使用说明">C语言编译器MINGW的使用说明</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6138317" title="VMware 网络配置">VMware 网络配置</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6134843" title="ubuntu开启ssh服务">ubuntu开启ssh服务</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6131767" title="RHEL5+net-snmp+监控宝实现服务器监控">RHEL5+net-snmp+监控宝实现服务器监控</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6130401" title="移殖net-snmp和应用net-snmp开发详解">移殖net-snmp和应用net-snmp开发详解</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6129460" title="使用net-snmp API编程">使用net-snmp API编程</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6128785" title="PROC编程基础">PROC编程基础</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6115305" title="23中设计模式">23中设计模式</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6115113" title="跟我一起写 Makefile">跟我一起写 Makefile</a><span>(0)</span>
</li>
<li>
<a href="http://blog.csdn.net/dingweili/article/details/6109516" title="linux之ls -l|grep &quot;^-&quot;|wc -l命令">linux之ls -l|grep "^-"|wc -l命令</a><span>(0)</span>
</li>
</ul>
</div>
<div id="homepageArticles" class="panel tracking-ad" data-mod="popu_4">
<ul class="panel_head"><span>推荐文章</span></ul>
<ul class="panel_body" id="ad_commend"><iframe src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ad_003.htm" style="border-width: 0px; overflow: hidden; width: 182px; height: 0px;" scrolling="no" id="ad_frm_2" frameborder="0"></iframe></ul>
</div>
<script type="text/javascript">
 new Ad(12, 'ad_commend');
</script>    </div>
    <div class="clear">
    </div>
</div>

            <div class="clear">
            </div>
        </div>
        

<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/cnick.js"></script>
<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/newblog.js"></script>


<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/showblogmedal.js"></script>
<script type="text/javascript">
    document.write('<script type="text/javascript" src="http://csdnimg.cn/pubfooter/js/publib_footer.js?' + Math.floor(new Date() / 120000).toString(36) + '="></' + 'script>');
</script><script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/publib_footer.js"></script><link rel="stylesheet" type="text/css" href="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/pub_footer_2012.css"><div id="pub_footerall" class="pub_footerall"><dl><dt></dt> <dd><a href="http://www.csdn.net/company/about.html" target="_blank">公司简介</a>|<a href="http://www.csdn.net/company/recruit.html" target="_blank">招贤纳士</a>|<a href="http://www.csdn.net/company/marketing.html" target="_blank">广告服务</a>|<a href="http://www.csdn.net/company/account.html" target="_blank">银行汇款帐号</a>|<a href="http://www.csdn.net/company/contact.html" target="_blank">联系方式</a>|<a href="http://www.csdn.net/company/statement.html" target="_blank">版权声明</a>|<a href="http://www.csdn.net/company/layer.html" target="_blank">法律顾问</a>|<a href="mailto:webmaster@csdn.net">问题报告</a>|<a target="_blank" href="http://www.csdn.net/friendlink.html">合作伙伴</a>|<a href="http://bbs.csdn.net/forums/Service" target="_blank">论坛反馈</a></dd><dd><a href="http://wpa.qq.com/msgrd?v=3&amp;uin=2355263776&amp;site=qq&amp;menu=yes" target="_blank" class="qq">网站客服</a> <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=2251809102&amp;site=qq&amp;menu=yes" target="_blank" class="qq">杂志客服</a> <a href="http://e.weibo.com/csdnsupport/profile" target="_blank" class="weibo">微博客服</a> <a href="mailto:webmaster@csdn.net" class="email" title="联系邮箱">webmaster@csdn.net</a> <span class="phone" title="服务热线">400-600-2320</span></dd><dd>京&nbsp;ICP&nbsp;证&nbsp;070598&nbsp;号</dd><dd>北京创新乐知信息技术有限公司 版权所有</dd><dd>江苏乐知网络技术有限公司 提供商务支持</dd><dd>Copyright © 1999-2014, CSDN.NET, All Rights Reserved&nbsp;<a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" target="_blank"><img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/gongshang_logos.gif" alt="GongshangLogo" title=""></a></dd></dl></div><div id="note1" class="csdn_note" style="display:none; position:absolute; z-index:9999; width:440px">  <span class="notice_top_arrow"><span class="inner"></span></span>  <div class="box"></div></div><div class="csdn_notice_tip" style="display:none; position:absolute; z-index:9990; width:170px">  <iframe src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/a_002.htm" scrolling="no" style="z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;background:transparent" frameborder="0"></iframe>  <div class="tip_text">您有<strong>0</strong>条新通知</div>  <a href="javascript:void%200" class="close2"></a></div><script id="noticeScript" type="text/javascript" btnid="header_notice_num" wrapid="note1" count="5" subcount="5" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/notify.js"></script>
    <script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/login.js"></script>
<script type="text/javascript">document.write("<img src=http://counter.csdn.net/pv.aspx?id=24 border=0 width=0 height=0>");</script><img src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/pv.xml" border="0" height="0" width="0">
<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/counter.js"></script><script type="text/javascript" charset="UTF-8" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/msg.js"></script>
<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ad-blog.js"></script><script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/ad-ms938.js"></script>

<script type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/count.js"></script><iframe src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/logs.htm" frameborder="0" height="0" width="0"></iframe>
<script type="text/javascript">
    $(function () {
        function __get_code_toolbar(snippet_id) {
            return $("<a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "' target='_blank' title='在CODE上查看代码片' style='text-indent:0;'><img src='https://code.csdn.net/assets/CODE_ico.png' width=12 height=12 alt='在CODE上查看代码片' style='position:relative;top:1px;left:2px;'/></a>"
                    + "<a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "/fork' target='_blank' title='派生到我的代码片'  style='text-indent:0;'><img src='https://code.csdn.net/assets/ico_fork.svg' width=12 height=12 alt='派生到我的代码片' style='position:relative;top:2px;left:2px;'/></a>");
        }
        
        $("[code_snippet_id]").each(function () {
            __s_id = $(this).attr("code_snippet_id");
            if (__s_id != null && __s_id != "" && __s_id != 0 && parseInt(__s_id) > 70020) {
                __code_tool = __get_code_toolbar(__s_id);
                $(this).prev().find(".tools").append(__code_tool);
            }
        });
    });
</script>

    </div>
      <!--new top-->
    
    <script id="csdn-toolbar-id" btnid="header_notice_num" wrapid="note1" count="5" subcount="5" type="text/javascript" src="PROC%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80%20-%20dingweili%E7%9A%84%E4%B8%93%E6%A0%8F%20-%20%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93%20-%20CSDN.NET_files/toolbar.js"></script>
     <!--new top-->


<div style="display: block;" id="tag-suggest-pop">
  <div class="relative">
    <div class="close"></div>
    <div class="content"><div><span>更多相关资源：</span><a href="http://www.csdn.net/tag/sql" title="关于 sql 的主题" target="_blank">sql</a></div></div>
  </div>
</div></body></html>